import Vue from 'vue'
import VueRouter from 'vue-router'
import Reg from '@/views/Reg//Reg.vue'
import Login from '@/views/Login/Login.vue'
import Home from '@/views/Home/Home.vue'
import Main from '@/views/Home/Main.vue'
import UserInfo from '@/views/User/UserInfo.vue'
import UserAvatar from '@/views/User/UserAvatar.vue'
import UserPwd from '@/views/User/UserPwd.vue'
import ArtCate from '@/views/Article/ArticleCate.vue'
import ArtList from '@/views/Article/ArticleList.vue'

Vue.use(VueRouter)

const routes = [
  //   {
  //     path: '/',
  //     redirect: '/home'
  //   },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/reg',
    component: Reg
  },

  {
    path: '/',
    component: Home,
    redirect: '/home',
    children: [
      {
        path: '/home',
        component: Main
      },
      {
        path: 'user-info',
        component: UserInfo
      },
      {
        path: 'user-avatar',
        component: UserAvatar
      },
      {
        path: 'user-pwd',
        component: UserPwd
      },
      {
        path: 'art-cate',
        component: ArtCate
      },
      {
        path: 'art-list',
        component: ArtList
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
